import Vue from "vue";
import Router from "vue-router";
import Home from "@/views/home";


Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      name: "home",
      component: Home
    },
   

    //product
    {path: "/product",name: "product",component: () => import('@/views/product/'), hidden: true},
    {path: "/product/add",name: "productadd",component: () => import('@/views/product/productAdd'), hidden: true},
    // {path: "/product/updata",name: "productupdata",component: () => import('@/views/product/productUpdata'), hidden: true},

    //news
    {path: "/news",name: "news",component: () => import('@/views/news/index'), hidden: true},
    {path: "/news/add",name: "newsadd",component: () => import('@/views/news/newsAdd'), hidden: true},
    {path: "/news/updata",name: "newsupdata",component: () => import('@/views/news/newsUpdata'), hidden: true},
    //模块下面主组件index.vue
    //user
    {path: "/users",name: "user",component: () => import('@/views/users/'), hidden: true},
    {path: "/login",name: "login",component: () => import('@/views/login/'), hidden: true},

    // //模块下面主组件index.vue
    // //user
    // {path: "/users",name: "user",component: () => import('@/views/user /'), hidden: true},
    {path: "/users/add",name: "useradd",component: () => import('@/views/users/userAdd'), hidden: true},
    {path: "/users/updata",name: "userupdata",component: () => import('@/views/users/userUpdata'), hidden: true},


    // //comment
    {path: "/comment",name: "comment",component: () => import('@/views/comment/'), hidden: true},
    // {path: "/comment/add",name: "commentadd",component: () => import('@/views/comment/commentAdd'), hidden: true},
    // {path: "/comment/updata",name: "commentupdata",component: () => import('@/views/comment/commentUpdata'), hidden: true},


    // //cate
    // {path: "/cate",name: "cate",component: () => import('@/views/cate/'), hidden: true},
    {path: "/cate",name: "cate",component: () => import('@/views/cate/'), hidden: true},
    // {path: "/cate/add",name: "cateadd",component: () => import('@/views/cate/cateAdd'), hidden: true},
    // {path: "/cate/updata",name: "cateupdata",component: () => import('@/views/cate/cateUpdata'), hidden: true},


    // //upload
    // {path: "/upload",name: "upload",component: () => import('@/views/upload/'), hidden: true},
    // {path: "/upload/add",name: "uploadadd",component: () => import('@/views/upload/uploadAdd'), hidden: true},
    // {path: "/upload/updata",name: "uploadupdata",component: () => import('@/views/upload/uploadUpdata'), hidden: true},

    
    {path: '/404', component: () => import('@/views/404'), hidden: true},//实现按需加载
    {path: '*', redirect: '/404'}
  ]
});
